package cn.weiron.fun.infrastructure.configuration;


import cn.weiron.fun.infrastructure.GlobalResponseHandler;
import cn.weiron.fun.infrastructure.auth.Authority;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.ControllerAdvice;

/**
 * <p>基础层：配置全局返回处理器</p>
 *
 * @author 马强
 */
@ControllerAdvice
public class ContractGlobalResponseHandler extends GlobalResponseHandler {
    private final Authority.AccountHandler accountHandler;

    public ContractGlobalResponseHandler(@Qualifier("authorityAccountHandler") Authority.AccountHandler accountHandler) {
        this.accountHandler = accountHandler;
    }

    @Override
    public Authority.AccountHandler getAccountHandler() {
        return accountHandler;
    }
}